Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: add a force option to pybullet #258

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Qwlouse
Copy link
Collaborator

@Qwlouse Qwlouse commented Jul 21, 2022

This was a draft for adding custom forces during the simulation.
Can be used like this:

random_forces = {
    obj.linked_objects[simulator]: {
        20*i+rng.randint(1, 20): (rng.uniform(*velocity_range), 0.2)
        for i in range(25)}
    for obj in scene.foreground_assets
}
animation, collisions = simulator.run(frame_start=0, frame_end=scene.frame_end+1, forces=random_forces)

The design is not ideal, because it requires listing the forces beforehand, so they cannot depend on dynamic state of the objects. Maybe a callback would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant